home *** CD-ROM | disk | FTP | other *** search
- #!/bin/bash -e
- # This script can be called in the following ways:
- #
- # After the package was installed:
- # <postinst> configure <old-version>
- #
- #
- # If prerm fails during upgrade or fails on failed upgrade:
- # <old-postinst> abort-upgrade <new-version>
- #
- # If prerm fails during deconfiguration of a package:
- # <postinst> abort-deconfigure in-favour <new-package> <version>
- # removing <old-package> <version>
- #
- # If prerm fails during replacement due to conflict:
- # <postinst> abort-remove in-favour <new-package> <version>
-
- . /usr/share/debconf/confmodule
-
- # Remove the alternative for the default artwork we used to ship
- rm_default_artwork()
- {
- update-alternatives --remove usplash-artwork.so \
- /usr/lib/usplash/usplash-default.so
- }
-
- # Update the initramfs
- update_initramfs()
- {
- if which update-initramfs >/dev/null 2>&1; then
- update-initramfs -u
- fi
- }
-
- # Write a config file
- setup_usplash_config()
- {
- if [ ! -f /etc/usplash.conf ]; then
- echo "# Usplash configuration file" >/etc/usplash.conf
- echo "# These parameters will only apply after running update-initramfs." >>/etc/usplash.conf
- echo "" >>/etc/usplash.conf
- db_version 2.0
- x=
- y=
- if db_get xserver-xorg/config/display/modes; then
- FIRSTVAL=`echo $RET | sed 's/,.*//'`
- x=`echo $FIRSTVAL | sed 's/x.*//'`
- y=`echo $FIRSTVAL | sed 's/.*x//'`
- elif [ "$DISPLAY" ] && which xdpyinfo >/dev/null 2>&1 && \
- dimensions="$(xdpyinfo | perl -nle 'if (/^\s*dimensions:\s*(\d+x\d+)/) { print $1; exit }')"; then
- x="${dimensions%%x*}"
- y="${dimensions#*x}"
- fi
- if [ "$x" ] && [ "$y" ]; then
- echo "xres=$x" >>/etc/usplash.conf
- echo "yres=$y" >>/etc/usplash.conf
- fi
- fi
- }
-
- case "$1" in
- configure)
- if dpkg --compare-versions "$2" lt-nl "0.3-1"; then
- rm_default_artwork
- fi
-
- if dpkg --compare-versions "$2" lt-nl "0.4-31" && \
- [ ! -e /usr/lib/usplash/usplash-artwork.so ]; then
- update-alternatives --auto usplash-artwork.so
- fi
-
- setup_usplash_config
-
- update_initramfs
- ;;
-
- abort-upgrade|abort-deconfigure|abort-remove)
- ;;
-
- *)
- echo "$0 called with unknown argument \`$1'" 1>&2
- exit 1
- ;;
- esac
-
- # Automatically added by dh_installinit
- update-rc.d -f usplash remove >/dev/null || exit $?
- # End automatically added section
-
-
- exit 0
-